<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st/gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

require __DIR__ . '/api.php';
// miss路由11
Route::miss(function () {
    return 'Route Not Found!';
});
// 首页
Route::get('/apple-app-site-association', function () {
    $aa = [
        'applinks' => [
            'apps' => [],
            'details' => [
                [
                    'appID' => 'YB6YANRH6P.com.legal.law',
                    'paths' => ["*"]
                ]
            ]
        ]
    ];
    return json($aa);
});
// 测试实例数据库
Route::get('/', function () {
    return '';
});
Route::get('index', 'index/index');
Route::any('test', 'index/test');
// api接口无需token模块
Route::group('admin', function () {
    // 首页路由
    Route::group('index', function () {
        Route::any('getCaptchaCode', 'admin.Index/getCaptchaCode');
        Route::any('login', 'admin.Index/login');
        Route::any('getWebConfig', 'admin.Index/getWebConfig');
    });
})->allowCrossDomain();
// 后端接口需token模块
Route::group('admin', function () {
    // 首页路由
    Route::group('index', function () {
        Route::any('getInfo', 'admin.Index/getInfo');
    });
    // 管理用户模块
    Route::group('admin_user', function () {
        Route::any('save', 'admin.AdminUser/save');// 添加用户
        Route::any('getUserInfo', 'admin.AdminUser/getUserInfo');// 获取用户信息
        Route::any('getList', 'admin.AdminUser/getList');// 获取用户列表
        Route::any('status', 'admin.AdminUser/status');// 启用，禁用
        Route::any('del', 'admin.AdminUser/del');// 删除用户
        Route::any('logout', 'admin.AdminUser/logout');// 退出登录
        Route::any('getUserInfo', 'admin.AdminUser/getUserInfo');// 退出登录
        Route::any('setUserInfo', 'admin.AdminUser/setUserInfo');// 退出登录
    });
    // 菜单模块
    Route::group('menu', function () {
        Route::any('getUserMenuList', 'admin.Menu/getUserMenuList');// 后台左侧菜单栏
        Route::any('getMenuList', 'admin.Menu/getMenuList');// 获取全部菜单列表
        Route::any('getRuleMenuList', 'admin.Menu/getRuleMenuList');// 配置菜单权限
        Route::any('getMenuInfo', 'admin.Menu/getMenuInfo');// 获取菜单信息
        Route::any('saveMenuInfo', 'admin.Menu/saveMenuInfo');// 修改菜单
        Route::any('add', 'admin.Menu/add');// 添加菜单
        Route::any('info', 'admin.Menu/info');// 菜单信息
        Route::any('del', 'admin.Menu/del');// 删除菜单
        Route::any('editRule', 'admin.Menu/editRule');// 配置角色规则
    });
    // 角色模块
    Route::group('role', function () {
        Route::any('save', 'admin.Role/save');// 添加角色
        Route::any('info', 'admin.Role/info'); // 角色信息
        Route::any('del', 'admin.Role/del');// 删除角色
        Route::any('saveRoleInfo', 'admin.Role/saveRoleInfo');//保存角色信息
        Route::any('getRoleList', 'admin.Role/getRoleList');// 获取角色列表
        Route::any('getNextRoleList', 'admin.Role/getNextRoleList');// 获取角色列表
        Route::any('getSelfAndNextRoleList', 'admin.Role/getSelfAndNextRoleList');// 获取角色列表
    });
    // 用户管理
    Route::group('user', function () {
        Route::any('getList', 'admin.User/getList');
        Route::any('save', 'admin.User/save');
        Route::any('del', 'admin.User/del');
        Route::any('status', 'admin.User/status');
        Route::any('editUser', 'admin.User/editUser');
        Route::any('getConfirmList', 'admin.User/getConfirmList');
        Route::any('confirm', 'admin.User/confirm');
    });
    // 陪驾教练管理
    Route::group('partner', function () {
        Route::any('getList', 'admin.Partner/getList');
        Route::any('save', 'admin.Partner/save');
        Route::any('del', 'admin.Partner/del');
        Route::any('status', 'admin.Partner/status');
        Route::any('getArr', 'admin.Partner/getArr');
        Route::any('getAreaList', 'admin.Partner/getAreaList');
        Route::any('addArea', 'admin.Partner/addArea');
        Route::any('getUserArea', 'admin.Partner/getUserArea');
    });
    // 学车教练管理
    Route::group('coach', function () {
        Route::any('getList', 'admin.Coach/getList');
        Route::any('save', 'admin.Coach/save');
        Route::any('del', 'admin.Coach/del');
        Route::any('getArr', 'admin.Coach/getArr');
        Route::any('getTeamList', 'admin.Coach/getTeamList');
    });
    // 优惠券
    Route::group('coupon', function () {
        Route::any('getList', 'admin.Coupon/getList');
        Route::any('save', 'admin.Coupon/save');
        Route::any('del', 'admin.Coupon/del');
        Route::any('record', 'admin.Coupon/record');
    });
    // 配置模块
    Route::group('config', function () {
        Route::any('setConfig', 'admin.Config/setConfig');// 网站配置
        Route::any('getConfigInfo', 'admin.Config/getConfigInfo');// 网站配置
        Route::any('getCityList', 'admin.Config/getCityList');// 城市列表
        Route::any('getOpenCityList', 'admin.Config/getOpenCityList')->name('开通城市');
    });
    // 活动试驾
    Route::group('article', function () {
        Route::any('getList', 'admin.Article/getList');
        Route::any('save', 'admin.Article/save');
        Route::any('del', 'admin.Article/del');
    });
    // 轮播图
    Route::group('banner', function () {
        Route::any('getList', 'admin.Banner/getList');
        Route::any('save', 'admin.Banner/save');
        Route::any('del', 'admin.Banner/del');
    });
    // 提现
    Route::group('withdraw', function () {
        Route::any('getList', 'admin.Withdraw/getList');
        Route::any('save', 'admin.Withdraw/save');
        Route::any('del', 'admin.Withdraw/del');
    });
    // 陪驾提现
    Route::group('partnerWithdraw', function () {
        Route::any('getList', 'admin.PartnerWithdraw/getList');
        Route::any('save', 'admin.PartnerWithdraw/save');
        Route::any('del', 'admin.PartnerWithdraw/del');
        Route::any('audit', 'admin.PartnerWithdraw/audit');
    });
    // 教练提现
    Route::group('coachWithdraw', function () {
        Route::any('getList', 'admin.CoachWithdraw/getList');
        Route::any('save', 'admin.CoachWithdraw/save');
        Route::any('del', 'admin.CoachWithdraw/del');
        Route::any('audit', 'admin.CoachWithdraw/audit');
    });
    //余额变更
    Route::group('finance', function () {
        Route::any('getList', 'admin.Finance/getList');
        Route::any('save', 'admin.Finance/save');
        Route::any('del', 'admin.Finance/del');
    });
    // 活动试驾报名
    Route::group('active_apply', function () {
        Route::any('getList', 'admin.ArticleApply/getList');
        Route::any('save', 'admin.ArticleApply/save');
        Route::any('del', 'admin.ArticleApply/del');
    });
    // 公告
    Route::group('notice', function () {
        Route::any('getList', 'admin.Notice/getList');
        Route::any('save', 'admin.Notice/save');
        Route::any('del', 'admin.Notice/del');
    });
    // 陪驾课程
    Route::group('course', function () {
        Route::any('getList', 'admin.UserCourse/getList');
        Route::any('save', 'admin.UserCourse/save');
        Route::any('del', 'admin.UserCourse/del');
        Route::any('getArr', 'admin.UserCourse/getArr');
    });
    // 陪驾测评
    Route::group('examine', function () {
        Route::any('getList', 'admin.UserExamine/getList');
        Route::any('save', 'admin.UserExamine/save');
        Route::any('del', 'admin.UserExamine/del');
        Route::any('getArr', 'admin.UserExamine/getArr');
    });
    // 陪驾测评
    Route::group('examine_record', function () {
        Route::any('getList', 'admin.UserExamineRecord/getList');
        Route::any('save', 'admin.UserExamineRecord/save');
        Route::any('del', 'admin.UserExamineRecord/del');
        Route::any('getArr', 'admin.UserExamineRecord/getArr');
    });
    // 驾校
    Route::group('school', function () {
        Route::group('base', function () {
            Route::any('getList', 'admin.school.SchoolBase/getList');
            Route::any('save', 'admin.school.SchoolBase/save');
            Route::any('del', 'admin.school.SchoolBase/del');
            Route::any('getArr', 'admin.school.SchoolBase/getArr');
        });
        Route::group('school', function () {
            Route::any('getList', 'admin.school.School/getList');
            Route::any('save', 'admin.school.School/save');
            Route::any('del', 'admin.school.School/del');
            Route::any('getArr', 'admin.school.School/getArr');
        });
        Route::group('course', function () {
            Route::any('getList', 'admin.school.SchoolCourse/getList');
            Route::any('save', 'admin.school.SchoolCourse/save');
            Route::any('del', 'admin.school.SchoolCourse/del');
        });
        Route::group('order', function () {
            Route::any('getList', 'admin.school.SchoolOrder/getList');
            Route::any('save', 'admin.school.SchoolOrder/save');
            Route::any('del', 'admin.school.SchoolOrder/del');
            Route::any('uploadCouponCode', 'admin.school.SchoolOrder/uploadCouponCode')->name('上传券码');
            Route::any('complete', 'admin.school.SchoolOrder/complete')->name('完成订单');
            Route::any('addRecord', 'admin.school.SchoolOrder/addRecord')->name('添加记录');
            Route::any('getRecordList', 'admin.school.SchoolOrder/getRecordList')->name('跟踪记录列表');
        });
    });
    Route::group('verify', function () {
        Route::group('shape', function () {
            Route::any('getList', 'admin.verify.VerifyCartShape/getList');
            Route::any('save', 'admin.verify.VerifyCartShape/save');
            Route::any('del', 'admin.verify.VerifyCartShape/del');
            Route::any('getArr', 'admin.verify.VerifyCartShape/getArr');
        });
        Route::group('menu', function () {
            Route::any('getList', 'admin.verify.VerifyCartMenu/getList');
            Route::any('save', 'admin.verify.VerifyCartMenu/save');
            Route::any('del', 'admin.verify.VerifyCartMenu/del');
            Route::any('getArr', 'admin.verify.VerifyCartMenu/getArr');
            Route::any('status', 'admin.verify.VerifyCartMenu/status');
        });
        Route::group('order', function () {
            Route::any('getList', 'admin.verify.VerifyCartOrder/getList');
            Route::any('save', 'admin.verify.VerifyCartOrder/save');
            Route::any('del', 'admin.verify.VerifyCartOrder/del');
            Route::any('getArr', 'admin.verify.VerifyCartOrder/getArr');
        });
        Route::group('report', function () {
            Route::any('getList', 'admin.verify.VerifyCartReport/getList');
            Route::any('save', 'admin.verify.VerifyCartReport/save');
            Route::any('del', 'admin.verify.VerifyCartReport/del');
            Route::any('getArr', 'admin.verify.VerifyCartReport/getArr');
        });
        Route::group('city', function () {
            Route::any('getCityArr', 'admin.verify.VerifyCartCity/getCityArr');
        });
    });
    // 视频
    Route::group('video', function () {
        Route::group('chapter', function () {
            Route::any('getList', 'admin.video.VideoChapter/getList');
            Route::any('save', 'admin.video.VideoChapter/save');
            Route::any('del', 'admin.video.VideoChapter/del');
            Route::any('getArr', 'admin.video.VideoChapter/getArr');
        });
        Route::group('node', function () {
            Route::any('getList', 'admin.video.VideoNode/getList');
            Route::any('save', 'admin.video.VideoNode/save');
            Route::any('del', 'admin.video.VideoNode/del');
            Route::any('getArr', 'admin.video.VideoNode/getArr');
        });
        Route::group('course', function () {
            Route::any('getList', 'admin.video.VideoCourse/getList');
            Route::any('save', 'admin.video.VideoCourse/save');
            Route::any('del', 'admin.video.VideoCourse/del');
            Route::any('getArr', 'admin.video.VideoCourse/getArr');
        });
    });
    // 财务
    Route::group('finance', function () {
        Route::group('coach_money', function () {
            Route::any('getBalanceType', 'admin.finance.CoachMoneyRecord/getBalanceType');
            Route::any('getList', 'admin.finance.CoachMoneyRecord/getList');
        });
        Route::group('partner_money', function () {
            Route::any('getBalanceType', 'admin.finance.PartnerMoneyRecord/getBalanceType');
            Route::any('getList', 'admin.finance.PartnerMoneyRecord/getList');
        });
    });
    // 评价
    Route::group('eval', function () {
        Route::any('getList', 'admin.Eval/getList');
        Route::any('del', 'admin.Eval/del');
    });
    // 投诉
    Route::group('complaint', function () {
        Route::any('getList', 'admin.Complaint/getList');
        Route::any('status', 'admin.Complaint/status');
    });
    // 反馈
    Route::group('feedback', function () {
        Route::any('getList', 'admin.Feedback/getList');
        Route::any('status', 'admin.Feedback/status');
    });
    Route::group('config', function () {
        Route::group('order_source', function () {
            Route::any('getList', 'admin.config.ConfigOrderSource/getList');
            Route::any('save', 'admin.config.ConfigOrderSource/save');
            Route::any('del', 'admin.config.ConfigOrderSource/del');
            Route::any('getArr', 'admin.config.ConfigOrderSource/getArr');
        });
    });
    // 陪驾
    Route::group('partner', function () {
        // 开通城市
        Route::group('city', function () {
            Route::any('getList', 'admin.partner.OpenCity/getList');
            Route::any('save', 'admin.partner.OpenCity/save');
            Route::any('del', 'admin.partner.OpenCity/del');
            Route::any('getArr', 'admin.partner.OpenCity/getArr');
        });
        // 预约列表
        Route::group('reserve', function () {
            Route::any('getList', 'admin.partner.ReserveOrder/getList');
            Route::any('save', 'admin.partner.ReserveOrder/save');
            Route::any('createVerifyOrder', 'admin.partner.ReserveOrder/createVerifyOrder');
            Route::any('del', 'admin.partner.ReserveOrder/del');
            Route::any('getArr', 'admin.partner.ReserveOrder/getArr');
            Route::any('getNearPartnerList', 'admin.partner.ReserveOrder/getNearPartnerList');
            Route::any('cancel', 'admin.partner.ReserveOrder/cancel')->name('取消订单');
            Route::any('checkCoupon', 'admin.partner.ReserveOrder/checkCoupon')->name('验券');
            Route::any('toPublic', 'admin.partner.ReserveOrder/toPublic')->name('放置大厅');
            Route::any('getNearPartnerList', 'admin.partner.ReserveOrder/getNearPartnerList')->name('附近教练列表');
            Route::any('setCoach', 'admin.partner.ReserveOrder/setCoach')->name('派单');
            Route::any('uploadVoucher', 'admin.partner.ReserveOrder/uploadVoucher')->name('上传券码');
            Route::any('getReasonList', 'admin.partner.ReserveOrder/getReasonList')->name('原因列表');
        });
        // 预约记录列表
        Route::group('reserve_log', function () {
            Route::any('getList', 'admin.partner.OrderLog/getList');
        });
        // 套餐列表
        Route::group('goods', function () {
            Route::any('getList', 'admin.partner.Goods/getList');
            Route::any('save', 'admin.partner.Goods/save');
            Route::any('del', 'admin.partner.Goods/del');
            Route::any('status', 'admin.partner.Goods/status');
            Route::any('getVerifyCartMenuArr', 'admin.partner.Goods/getVerifyCartMenuArr');
        });
        // 套餐订单列表
        Route::group('order', function () {
            Route::any('getList', 'admin.partner.Order/getList');
            Route::any('getTotalList', 'admin.partner.Order/getTotalList');
            Route::any('save', 'admin.partner.Order/save');
            Route::any('modifyDuration', 'admin.partner.Order/modifyDuration');
            Route::any('del', 'admin.partner.Order/del');
            Route::any('status', 'admin.partner.Order/status');
        });
        // 套餐订单记录列表
        Route::group('order_log', function () {
            Route::any('getList', 'admin.partner.EscortMenuOrderLog/getList');
        });
    });
    // 回收站
    Route::group('recycle', function () {
        Route::any('getList', 'admin.Recycle/getList');
        Route::any('back', 'admin.Recycle/back');
        Route::any('clear', 'admin.Recycle/clear');
    });
    // 订单中心
    Route::group('order', function () {
        Route::any('getList', 'admin.Order/getList');
    });
    // reason
    Route::group('reason', function () {
        Route::any('getList', 'admin.CancelReason/getList');
        Route::any('save', 'admin.CancelReason/save');
        Route::any('del', 'admin.CancelReason/del');
        Route::any('getArr', 'admin.CancelReason/getArr');
    });
    // 统计
    Route::group('statistics', function () {
        Route::group('income', function () {
            Route::any('getList', 'admin.statistics.Income/getList');
        });

    });
    // 上传
    Route::group('file', function () {
        Route::any('upload', 'admin.File/upload');
        Route::any('uploadImage', 'admin.File/uploadImage');
        Route::any('getSearchList', 'admin.File/getSearchList');
    });
})->allowCrossDomain()->middleware('auth');
